#ifndef HOME_H
#define HOME_H

#include <QWidget>
#include <QtNetwork>
#include <QCloseEvent>
#include "friendquest.h"
#include "control.h"

namespace Ui {
class home;
}

class home : public QWidget
{
    Q_OBJECT

public:
    explicit home(QWidget *parent = nullptr);
    ~home();
    QTimer *timer;
    QTimer *timer2;
    QTimer *timer3;
    QTimer *fqtimer;

private slots:
    void on_pushButton_quit_clicked();
    void on_pushButton_sendmessage_clicked();
    void Createdfriendlist();
    void on_pushButton_addpeople_clicked();

    void on_pushButton_startchat_clicked();

    void on_pushButton_deletepeople_clicked();
    void on_pushButton_sendfile_clicked();

    void on_pushButton_receivefile_clicked();

    void on_pushButton_fresh_clicked();

    void delTemFriend();

    void onlineDelFriend(QString delFName);

    void checkFriendQuest();

    void on_pushButton_friend_requests_clicked();

    void updateButtonVisibility();

    void chatFriendFromtemChat(QString fname);

    void on_pushButton_rejectFile_clicked();

signals:
    void wquit();

protected:
    void closeEvent(QCloseEvent *event);
private:
    Ui::home *ui;
    QTcpSocket *tcpSocket;
//    QString temfriendname;
    QTcpServer* uniqueServer; // 只用于接收广播包
    QTcpSocket* uniqueSocket;
};

#endif // HOME_H
